﻿<div id="comments">
          <div class="box2">
            <div class="box">
              <div class="FormTop"></div>
              <h2 class="title">就等您点评了</h2>
              <div>
                <form action="/post_comment" method="post" id="commentform"  onSubmit="return check_submit_comment(this);">
                  <label for="author">你的名字</label>
                  <p class="inputfc">
                    <input type="text" size="25" name="author" id="author" value=""/>
                  </p>
                  <label for="email">你的邮箱（我们不会公开你的邮箱的）</label>
                  <p class="inputfc">
                    <input type="text" size="25" name="email" id="email"  value=""/>
                  </p>
                  <label for="url">你的网站（请不要加http://）</label>
                  <p class="inputfc">
                    <input type="text" size="25" name="url" id="url"  value=""/>
                  </p>
                   <p id="checkarea">麻烦，计算一下：<span style="color:#D50000" id="disp_check">{{checknum1}}+{{checknum2}}=</span>
						<input type="hidden" name="checknum" id="checknum" value="{{checknum1}}+{{checknum2}}" />
						<input type="text" name="checkret" id="checkret" value="" size="5" tabindex="4" style="border:1px solid #ccc;padding:5px;background-color:#EEE;height:15px;"/>
						<input type="hidden" name="key" value="{{entry.key}}" />
					</p>
                    
                  <label>评论内容</label>
                  <p>
                    <textarea name="comment" id="comment"  cols="50" rows="10"></textarea>
                  </p>
                  <p>
                    <input type="submit" class="submit" value="提交评论"/>
                  </p>
                </form>
              </div>
            </div>
          </div>
          
           {% if entry.comments.count%}
            {% for comment in entry.comments %}
          <div class="ComListLi" id="comment-{{comment.key.id}}">
            <div class="ComListLiTop"></div>
            <div class="ListUser"><a rel="external nofollow" href="{{comment.weburl}}">{{comment.author}}</a></div>
            <p class="ListDate"><a href="#comment-{{comment.key.id}}" title="">{{comment.date.date|datetz:"Y-m-d"}}</a></p>
            <span class="ListNr">1</span>
            <div id="comment-1947" class="ListContent">
              <p>{{comment.content}}</p>
            </div>
          </div>
           {%endfor%}
           {%endif%}
           
        </div>
        
        <script type="text/javascript">
					function check_submit_comment(form){
              		   if (form.author) {

	              			 if (!form.author.value || form.author.value =="")
		              		 {
		              		  alert('请输入你的名字!');
		              		  form.author.focus();
		              		  return false;
		              		 }
		              		 if (!form.email.value || form.email.value=="")
		              		 {
		              		 	alert('请输入邮件地址');
		              		 	form.email.focus();
		              		 	return false;
		              		 }
           		       }
           		        if ($('#checkarea').css('display')!='none')
								       {
							             if(eval(form.checknum.value)!=form.checkret.value)
							             {
							               alert('计算错误，这个算术好像在幼儿园学过的吧？');
							               form.checkret.value='';
							               form.checkret.focus();
							               return false;
							             }

							           }

                  		 if (!form.comment.value || form.comment.value == "")
                  		 {
                  		 	alert('请输入留言内容');
                  		 	form.comment.focus();
                  		 	return false;
                  		 }
	              		 return true;

              		}
					</script>